﻿using mediaControl.ViewModels;
using mediaControl.Views;
using Prism.Ioc;
using Prism.Unity;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Windows;

namespace mediaControl
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : PrismApplication
    {
        /// <summary>
        /// 创建一个入口窗口
        /// </summary>
        /// <returns></returns>
        protected override Window CreateShell()
        {

             //AppDomain.CurrentDomain.AssemblyResolve += Resolver;
            //Any CefSharp references have to be in another method with NonInlining
            // attribute so the assembly rolver has time to do it's thing.
            //InitializeCefSharp();
            //return Container.Resolve<MainWindow>();
            return Container.Resolve<Main>();
        }

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterDialog<NewProgram, NewProgramViewModel>("newProgram");
            containerRegistry.RegisterDialog<UpdateProgram, UpdateProgramViewModel>("updateProgram");
            containerRegistry.RegisterDialog<AddMusic, AddMusicViewModel>("addMusic");
            containerRegistry.RegisterDialog<AddBlank, AddBlankViewModel>("addBlank");
            containerRegistry.RegisterDialog<PlaySetting, PlaySettingViewModel>("playSetting");
            containerRegistry.RegisterForNavigation<ProgramList, ProgramListViewModel>("ProgramList");
            containerRegistry.RegisterForNavigation<ProgramSetting, ProgramSettingViewModel>("ProgramSetting");
            containerRegistry.RegisterForNavigation<HomePage, HomePageViewModel>("HomePage");
            containerRegistry.RegisterForNavigation<MainWindow, MainWindowViewModel>("MainWindow");
            containerRegistry.RegisterForNavigation<Monitor,MonitorViewModel>("Monitor");
            containerRegistry.RegisterForNavigation<Monitor1,Monitor1ViewModel>("Monitor1");
            containerRegistry.RegisterForNavigation<Monitor2, Monitor2ViewModel>("Monitor2");
            containerRegistry.RegisterForNavigation<Monitor3, Monitor3ViewModel>("Monitor3");
            containerRegistry.RegisterForNavigation<Monitor4, Monitor4ViewModel>("Monitor4");
            containerRegistry.RegisterDialog<Webpage, WebpageViewModel>("Webpage");
            containerRegistry.RegisterDialog<ScreenSetting, ScreenSettingViewModel>("screenSetting");
            containerRegistry.RegisterForNavigation<ScreenList, ScreenListViewModel>("ScreenList");
            containerRegistry.RegisterDialog<SaveAsProgram, SaveAsProgramViewModel>("saveAsProgram");
            containerRegistry.RegisterDialog<Password, PasswordViewModel>("password");
        }

    }
}
